package game.block;

import game.block.game.GameState;
import game.block.sound.ConsoleAudio;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Preferences;

public class PuzzleBlock extends Game {
	private int level;
	public static int DEFAULT_LEVEL=1;
	
    @Override
    public void create() {
    	level=DEFAULT_LEVEL;
        readSave();
        Locator.init(this, level);
        //Locator.provideAudio(new NullAudio());
        Locator.provideAudio(new ConsoleAudio());
        Locator.getAudio().pickMusic();
        GameState gs=new GameState(this);
        Locator.provideGameState(gs);
        gs.mainMenu();
    }

    public void readSave() {
    	Preferences prefs = Gdx.app.getPreferences("My Preferences");
    	level = prefs.getInteger("MaxLevel", DEFAULT_LEVEL);
    }

    @Override
    public void render() {
        super.render();
    }

    @Override
    public void dispose() {
        super.dispose();
    }

    @Override
    public void resize(int width, int height) {
        super.resize(width, height);
    }

    @Override
    public void pause() {
        super.pause();
    }

    @Override
    public void resume() {
        super.resume();
    }
}
